package com.jd.dict.run;

import com.jd.dict.helper.DaoHelper;
import com.jd.dict.helper.DataDictHelper;
import com.jd.dict.model.TableFieldInfoModel;
import com.jd.dict.model.TableInfoModel;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Created by liuhaiming on 2017/7/28.
 */
public class RunnerFindField {
    public static void main(String[] args) {
        Set<String> fieldSet = new HashSet<String>();
        fieldSet.add("address");
        fieldSet.add("mobile");
        fieldSet.add("idcard");

        try {
            List<TableInfoModel> tableList = DaoHelper.findAllTableInfo();
            for (TableInfoModel table : tableList) {
                for (TableFieldInfoModel tableFieldInfoModel : table.getFieldList()) {
                    if (fieldSet.contains(tableFieldInfoModel.getKey())) {
                        System.out.println(table.getTableName());
                    }
                }
            }

            System.out.println("扫描完毕！");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
